<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<%@include file="/pages/include/base-head.jsp"%>
  </head>
  <body>
		<div style="padding: 20px;">
		    <h2>Spring MVC Rest风格版 Demo</h2>
		    <hr>
		    <a href="${contextPath}/demo/add">添加</a>
		    <table border="1" style="border-collapse:collapse;width:900px;">
		    	<thead>
		    		<tr>
		    			<th>ID</th>
		    			<th>姓名</th>
		    			<th>身高(单位:cm)</th>
		    			<th>生日</th>
		    			<th>状态</th>
		    			<th>创建时间</th>
		    			<th>备注</th>
		    			<th>操作</th>
		    		</tr>
		    	</thead>
		    	<tbody>
		    		<c:forEach var="d" items="${pagin.dataList}">
			    		<tr>
			    			<td>${d.id}</td>
			    			<td>${d.name}</td>
			    			<td>${d.height}</td>
			    			<td><fmt:formatDate value="${d.birthday}" pattern="yyyy-MM-dd" /></td>
			    			<td>${d.status==0?'启用':'禁用'}</td>
			    			<td><fmt:formatDate value="${d.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
			    			<td>${d.remark}</td>
			    			<td>
				    			<a href="${contextPath}/demo/update/${d.id}">修改</a>
				    			<a href="${contextPath}/demo/delete/${d.id}">删除</a>
			    			</td>
			    		</tr>
		    		</c:forEach>
		    	</tbody>
		    	<tfoot>
		    		<tr>
		    			<td colspan="8">
		    				<a href="${contextPath}/demo?page=${pagin.firstPage}">首页</a>
		    				<a href="${contextPath}/demo?page=${pagin.prevPage}">上一页</a>
		    				<a href="${contextPath}/demo?page=${pagin.nextPage}">下一页</a>
		    				<a href="${contextPath}/demo?page=${pagin.lastPage}">末页 </a>
		    				${pagin.page}/${pagin.lastPage} 总计:${pagin.totalCount}行
		    			</td>
		    		</tr>
		    	</tfoot>
		    </table>
		</div>
  </body>
</html>